package com.clinic.accessor.db;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Component;

import com.clinic.entity.db.User;

@Component
public class UserAccessor extends AbstractDbAccessor<User> {
	
	public User getUserById(long id) {
		DetachedCriteria criteria = DetachedCriteria.forClass(User.class);
		criteria.add(Restrictions.eq(User.Columns.USER_ID, id));
		return uniqueGeneric(criteria);
	}

}
